package com.supreme.studyserver.component;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class QumApplicationContext implements ApplicationContextAware {

    private static ApplicationContext applicationContext;
    private static ConfigurableApplicationContext configurableApplicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("QumApplicationContext");
        configurableApplicationContext = (ConfigurableApplicationContext) applicationContext;
    }

    public static void applicationStop() {
        configurableApplicationContext.stop();
    }
}
